package com.three.lab.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class ClassifyBean implements Parcelable {

    private int id;
    private String name;
    private boolean select;

    public ClassifyBean() {
    }

    public ClassifyBean(int id, String name, boolean select) {
        this.id = id;
        this.name = name;
        this.select = select;
    }

    protected ClassifyBean(Parcel in) {
        id = in.readInt();
        name = in.readString();
        select = in.readByte() != 0;
    }

    public static final Creator<ClassifyBean> CREATOR = new Creator<ClassifyBean>() {
        @Override
        public ClassifyBean createFromParcel(Parcel in) {
            return new ClassifyBean(in);
        }

        @Override
        public ClassifyBean[] newArray(int size) {
            return new ClassifyBean[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isSelect() {
        return select;
    }

    public void setSelect(boolean select) {
        this.select = select;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(name);
        dest.writeByte((byte) (select ? 1 : 0));
    }
}
